<?php

require_once '../include/common.inc.php';
if (!checkAdmin()) {
   header("LOCATION:index.php");
   exit;
}
$menu_index = 2;
$page_title = 'TABLA';
$guide_message = 'Customer | Promoter Information | Edit';

getMyParam('cid');
$sql="select * from promoter_info where id=$cid";
$query = $db->query($sql);
$rs = $db->fetch_array($query);
//var_dump($rs);

$phone_ary=explode('||',$rs['phone']);
$phone1=$phone_ary[0];
$phone=$phone_ary[1];

$mobile_ary=explode('||',$rs['mobile']);
$mobile1=$mobile_ary[0];
$mobile=$mobile_ary[1];

$fax_ary=explode('||',$rs['fax']);
$fax1=$fax_ary[0];
$fax=$fax_ary[1];

//Status
$cur_status=$rs['status'];
if($rs['status']==0) $status="<option value='0' selected='selected' >Non-Approve</option>
                          <option value='1'>Approved</option>
                          <option value='2' >Disapproved</option>";

if($rs['status']==1) $status="<option value='0' >Non-Approve</option>
                          <option value='1'selected='selected' >Approved</option>
                          <option value='2' >Disapproved</option>";
						  
if($rs['status']==2) $status="<option value='0' >Non-Approve</option>
                          <option value='1'>Approved</option>
                          <option value='2' selected='selected'>Disapproved</option>";
						  
//Rank
if($rs['rank']==1 or $rs['rank']==0) $rank="<input name='rank' type='radio' value='1'  checked='checked' />
                        $RANK_ARY[1]
                        <input name='rank' type='radio' value='2'  />
                       $RANK_ARY[2]
                        <input name='rank' type='radio' value='3' />
                        $RANK_ARY[3]";
if($rs['rank']==2) $rank="<input name='rank' type='radio' value='1'   />
                        $RANK_ARY[1]
                        <input name='rank' type='radio' value='2' checked='checked' />
                        $RANK_ARY[2]
                        <input name='rank' type='radio' value='3' />
                         $RANK_ARY[3]";
if($rs['rank']==3) $rank="<input name='rank' type='radio' value='1'  />
                        $RANK_ARY[1]
                        <input name='rank' type='radio' value='2'  />
                        $RANK_ARY[2]
                        <input name='rank' type='radio' value='3' checked='checked' />
                        $RANK_ARY[3]";					
//var_dump($rs);
//FAQ1--8
/*if($rs['faq1']==1) $faq1="<input name='faq1' type='radio' class='inputimage' id='faq1' value='1' checked>";
else $faq1="<input name='faq1' type='radio' class='inputimage' id='faq1' value='1' >";

if($rs['faq2']==1) $faq2="<input name='faq1' type='radio' class='inputimage' id='faq2' value='0' checked>";
else $faq2="<input name='faq1' type='radio' class='inputimage' id='faq2' value='0' >";*/
if($rs['faq1']==1) {$faq1="Yes";$faq2="No";}
else {$faq1="No";$faq2="Yes";}

if($rs['faq3']==1) $faq3="<input name='faq3' type='checkbox' class='inputimage' id='faq3' value='1' checked>";
else $faq3="<input name='faq3' type='checkbox' class='inputimage' id='faq3' value='1' >";

if($rs['faq4']==1) $faq4="<input name='faq4' type='checkbox' class='inputimage' id='faq4' value='1' checked>";
else $faq4="<input name='faq4' type='checkbox' class='inputimage' id='faq4' value='1' >";

if($rs['faq5']==1) $faq5="<input name='faq5' type='checkbox' class='inputimage' id='faq5' value='1' checked>";
else $faq5="<input name='faq5' type='checkbox' class='inputimage' id='faq5' value='1' >";

if($rs['faq6']==1) $faq6="<input name='faq6' type='checkbox' class='inputimage' id='faq6' value='1' checked>";
else $faq6="<input name='faq6' type='checkbox' class='inputimage' id='faq6' value='1' >";

if($rs['faq7']==1) $faq7="<input name='faq7' type='checkbox' class='inputimage' id='faq7' value='1' checked>";
else $faq7="<input name='faq7' type='checkbox' class='inputimage' id='faq7' value='1' >";

if($rs['faq8']==1) $faq8="<input name='faq8' type='checkbox' class='inputimage' id='faq8' value='1' checked>";
else $faq8="<input name='faq8' type='checkbox' class='inputimage' id='faq8' value='1' >";

include_once('menu_list.php');
require_once PrintEot('a_header');
require_once PrintEot('a_c_promoter_edit');
require_once PrintEot('a_footer');

?>